#include<iostream>
using namespace std;

int sumup( int n, int m)
{
    for ( int i = n; i <= m; i++)
    {
        n += i;
    }
    n -= 2;
    return n;
}

int main()
{
    int n,m;
    cin >> n >>m;
    int sum = sumup( n , m);
    cout << sum;

    return 0;
}